﻿@model AddressModel
@using Nop.Web.Models.Common;

<div class="address-form">
    @Html.HiddenFor(model => model.Id)
    <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
        @Html.RequiredHint()
        @Html.LabelFor(model => model.FirstName)
        <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.FirstName)</div>
        @Html.TextBoxFor(model => model.FirstName, new { @class = "form-control" })
    </div>
    <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
        @Html.RequiredHint()
        @Html.LabelFor(model => model.LastName)
        <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.LastName)</div>
        @Html.TextBoxFor(model => model.LastName, new { @class = "form-control" })
    </div>
    @if (Model.CompanyEnabled)
    {
        <div class="address-field address-field-long col-xxs-12 col-xs-12 col-sm-12 col-md-12 col-lg-12">
            @if (Model.CompanyRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.Company)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.Company)</div>
            @Html.TextBoxFor(model => model.Company, new { @class = "form-control" })
        </div>
    }
        
    @if (Model.StreetAddressEnabled)
    {
        <div class="address-field address-field-margin address-field-long col-xxs-12 col-xs-12 col-sm-9 col-md-9 col-lg-9">
            @if (Model.StreetAddressRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.Address1)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.Address1)</div>
            @Html.TextBoxFor(model => model.Address1, new { @class = "form-control" })
        </div>
    }

    @if (Model.StreetAddress2Enabled)
    {
        <div class="address-field address-field-long col-xxs-12 col-xs-12 col-sm-3 col-md-3 col-lg-3">
            @if (Model.StreetAddress2Required)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.Address2)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.Address2)</div>
            @Html.TextBoxFor(model => model.Address2, new { @class = "form-control" })
        </div>
    }
       
    @if (Model.CityEnabled)
    {
        <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
            @if (Model.CityRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.City)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.City)</div>
            @Html.TextBoxFor(model => model.City, new { @class = "form-control" })
        </div>
    }

    @if (Model.ZipPostalCodeEnabled)
    {
        <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
            @if (Model.ZipPostalCodeRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.ZipPostalCode)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.ZipPostalCode)</div>
            @Html.TextBoxFor(model => model.ZipPostalCode, new { @class = "form-control" })
        </div>
    }
    @if (Model.CountryEnabled && Model.StateProvinceEnabled)
    {
        <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
            @Html.RequiredHint()
            @Html.LabelFor(model => model.StateProvinceId)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.StateProvinceId)</div>
            @Html.DropDownListFor(model => model.StateProvinceId, Model.AvailableStates, new { @class = "form-control" })

        </div>
    }
    @if (Model.CountryEnabled)
    {
        <div class="address-field address-field-margin col-xxs-12 col-xs-12 col-sm-6 col-md-6 col-lg-6">
            @Html.LabelFor(model => model.CountryId)
            @Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, new { @class = "form-control country-form"})
        </div>
    }
    <div class="address-field address-field-margin address-field-long col-xxs-12 col-xs-12 col-sm-4 col-md-4 col-lg-4">
        @Html.LabelFor(model => model.Email)
        <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.Email)</div>
        @Html.TextBoxFor(model => model.Email, new { @class = "form-control" })
    </div>
    @if (Model.CellPhoneEnabled)
    {
        <div class="address-field address-field-long col-xxs-12 col-xs-12 col-sm-4 col-md-4 col-lg-4">
            @if (Model.CellPhoneRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.CellPhoneNumber)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.CellPhoneNumber)</div>
            @Html.TextBoxFor(model => model.CellPhoneNumber, new { @class = "form-control" })
        </div>
    }
    @if (Model.PhoneEnabled)
    {
        <div class="address-field address-field-long col-xxs-12 col-xs-12 col-sm-4 col-md-4 col-lg-4">
            @if (Model.PhoneRequired)
            {
                @Html.RequiredHint()
            }
            @Html.LabelFor(model => model.PhoneNumber)
            <div class="form-error-float"><div class="form-error-float-tail"></div>@Html.ValidationMessageFor(model => model.PhoneNumber)</div>
            @Html.TextBoxFor(model => model.PhoneNumber, new { @class = "form-control" })
        </div>
    }
    <div class="clear"></div>
</div>